package com.kingmed.kmss.common.dto.admin.ums;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;

@Getter
@Setter
@ApiModel(description = "组织机构DTO：集团、大区、子公司平铺")
public class OrganizationTileDTO implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("集团")
    private Long groupId;

    @ApiModelProperty("集团名称")
    private String groupName;

    @ApiModelProperty("集团代码（kmcs）")
    private String groupCodeKmcs;

    @ApiModelProperty("大区")
    private Long regionId;

    @ApiModelProperty("大区名称")
    private String regionName;

    @ApiModelProperty("大区代码（kmcs）")
    private String regionCodeKmcs;

    @ApiModelProperty("子公司")
    private Long subCompanyId;

    @ApiModelProperty("子公司名称")
    private String subCompanyName;

    @ApiModelProperty("子公司代码（kmcs）")
    private String subCompanyCodeKmcs;

    @ApiModelProperty("孙公司")
    private Long subChildCompanyId;

    @ApiModelProperty("孙公司名称")
    private String subChildCompanyName;

    @ApiModelProperty("孙公司代码（kmcs）")
    private String subChildCompanyCodeKmcs;

    public Integer getOrgLevel() {
        if ( regionId == null) {
            return 1;
        } else if (subCompanyId == null) {
            return 2;
        } else return 3;
    }

}
